<?php
#[更改密码]
$sysnav = "manager";

if($sysact == "setpassok")
{
	$passnew = $STR->safe($passnew);
	$passchk = $STR->safe($passchk);
	if(!$passnew || !$passchk)
	{
		Error("请输入新密码",$mainlink."?file=setpass");
	}
	if(!valid_pass($passnew))
	{
		
		Error("密码复杂度不够，请重新设置.",$mainlink."?file=setpass");
		
	}
	if($passnew != $passchk)
	{
		Error("不允许修改，两次密码输入不一致",$mainlink."?file=setpass");
	}
	$sql = "UPDATE ".$prefix."admin SET pass='".md5($passnew)."',passdate='".$system_time."' WHERE id='".$_SESSION["admin"]["id"]."'";
	$DB->qgQuery($sql);
	$sql = "SELECT * FROM ".$prefix."admin WHERE id='".$_SESSION["admin"]["id"]."'";
	$rs = $DB->qgGetOne($sql);
	$_SESSION["admin"] = $rs;
	Error("密码更新成功！下次登录请使用新密码",$mainlink."?file=setpass");
}
Foot("setpass.qg");
?>